import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Vector;

public class Generics2 {

	static void printCollection(Collection<Object> c) {
		for (Object o : c)
			System.out.println(o);
	}

	static void printCollection1(Collection<?> c) {
		for (Object o : c)
			System.out.println(o);
	}

	static void printCollection2(Collection<? extends Number> c) {
		for (Object o : c)
			System.out.println(o);
	}

	public static void main(String[] args) {
		List<Integer> li = new ArrayList<Integer>(10);
		//printCollection(li); // Compile error
		printCollection1(li);
		printCollection2(li);
		Collection<String> cs = new Vector<String>();
		//printCollection(cs); // Compile error
		printCollection1(cs);
		//printCollection2(cs);// Compile error
	}
}
